<?php

/*
 接口名称：/erpStudent/add
 接口描述：新增学员
*/

//获取参数
$os_name              = $route->bodyParams['os_name'];
$os_source            = $route->bodyParams['os_source'];
$os_parents_identity  = $route->bodyParams['os_parents_identity'];
$os_phone             = $route->bodyParams['os_phone'];
$os_sex               = $route->bodyParams['os_sex'];
$os_birthday          = $route->bodyParams['os_birthday'];
$os_school            = $route->bodyParams['os_school'];
$os_provinces         = $route->bodyParams['os_provinces'];
$os_city              = $route->bodyParams['os_city'];
$os_area              = $route->bodyParams['os_area'];
$os_address           = $route->bodyParams['os_address'];
$os_job               = $route->bodyParams['os_job'];
$os_level_of_learning = $route->bodyParams['os_level_of_learning'];
$os_evaluate          = $route->bodyParams['os_evaluate'];
$os_course_id         = $route->bodyParams['os_course_id'];
$os_address           = $route->bodyParams['os_address'];
$os_header_url        = $route->bodyParams['os_header_url'];
$os_oesid             = $route->bodyParams['os_oesid'];
$os_status            = $route->bodyParams['os_status'];
$is_follow            = $route->bodyParams['is_follow'];
$oa_study_grade       = $route->bodyParams['oa_study_grade'];
$oa_economics_grade   = $route->bodyParams['oa_economics_grade'];
$os_create_time       = !$regexpObj->bodyV($response,$route,'os_create_time','NUMBER') ? time():$regexpObj->bodyV($response,$route,'os_create_time','NUMBER') ;        //关联机构id

//写入数组
$insertArr = [
    'os_name'              => $os_name,
    'os_source'            => $os_source,
    'os_parents_identity'  => $os_parents_identity,
    'os_phone'             => $os_phone,
    'os_sex'               => $os_sex,
    'os_birthday'          => $os_birthday,
    'os_school'            => $os_school,
    'os_provinces'         => $os_provinces,
    'os_city'              => $os_city,
    'os_area'              => $os_area,
    'os_address'           => $os_address,
    'os_job'               => $os_job,
    'os_level_of_learning' => $os_level_of_learning,
    'os_evaluate'          => $os_evaluate,
    'os_course_id'         => $os_course_id,
    'os_oesid'              => $os_oesid,
    'os_header_url'        => $os_header_url,
    'os_status'             => $os_status,
    'is_follow'             => $is_follow,
    'os_username'           => $os_phone,
    'os_password'          => md5('123456'),
    'os_create_time'       => $os_create_time,
    'oa_study_grade'       => $oa_study_grade,
    'oa_economics_grade'       => $oa_economics_grade
];

//执行写入语句
$rsData = $db->mysqlDB->insert("oa_student",$insertArr);

//返回成功结果
$response->responseData( true, $rsData );